#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdio>
using namespace std;

//c++
int getnum(int *a, int k) {
	int s = 0;
	for (int i = k - 1; i >= 0; i--) {
		s += pow(10, (k - 1 - i)) * a[i];
	}
	return s;
}

void calculate(char *a, int l, char c, char *res) {
	int k = 0, n[10] = {0}, digit, r, time = 0, tag = 1;
	for (int i = 0; i < l; i++) {
		if (a[i] >= '0' && a[i] <= '9') {
			if (a[i - 1] == '-')
				tag = 0;
			for (int j = i;; j++) {
				n[k++] = a[j] - '0';
				i++;
				if (!(a[i] >= '0' && a[i] <= '9')) {
					i--;
					time++;
					digit = getnum(n, k);
					if (tag == 0)
						digit *= -1;
					if (time == 1)
						r = digit;
					else {
						if (c == '+')
							r += digit;
						else if (c == '-')
							r -= digit;
						else if (c == '*')
							r *= digit;
						else if (c == '/') {
							if (digit == 0)
								break;
							r /= digit;
						}
					}
					k = 0;
					break;
				}
			}
		}
	}
	int v = 0, flag = 1;
	if (r < 0) {
		flag = 0;
		r = -r;
	} else if (r == 0)
		res[v++] = '0';
	while (r) {
		res[v++] = (r % 10) + '0';
		r /= 10;
	}
	if (flag == 0)
		res[v++] = '-';
	res[v] = '\0';
	reverse(res, res + v);
}

int main() {
	char s[100], c, res[10] = {0}, t[100] = {0};
	int n[10], k, low, high;
	cin.getline(s, 100);
	for (int i = 0; i < strlen(s); i++) {
		if (s[i] == '(') {
			low = i;
			c = s[i + 1];
		} else if (s[i] == ')') {
			high = i;
			calculate(s + low, high - low + 1, c, res);
			strncpy(t, s, low);
			strcat(t, res);
			strcat(t, s + high + 1);
			memset(s, 0, sizeof(s));
			strcpy(s, t);
			memset(t, 0, sizeof(t));
			memset(res, 0, sizeof(res));
//            for(int j=0;j<strlen(s);j++)
//                printf("%c",s[j]);
//            printf("\n");
			i = -1;
		}
	}
	printf("%s\n", s);

	return 0;
}
